from docx import Document

def read_by_pages_and_images(file,image):
    all_pages=[]
    doc = Document(file)

    if doc.paragraphs:
        for i, para in enumerate(doc.paragraphs):
            one={
                "txt":para,
                'image':image.get(i,None)
            }
            all_pages.append(one)
    return all_pages
def read_by_pages(text):
    all_pages=[]
